<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax</title>
</head>
<body>
<input type="button" value="发布" id="id1" onclick="send()">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
    function send() {
        $.post(
            '/community/ajax/test1',
            {'name':'AA', 'age':15},
            function (data) {
                console.log(typeof(data));
                console.log(data);

                data = $.parseJSON(data);
                console.log(typeof(data));
                console.log(data.msg);
                console.log(data.code);

            }
        );
    }
</script>
</body>
</html>